﻿
using ServicesComponent.Repositories.Core;

namespace ServicesComponent.Repositories
{
    /// <summary>
    /// Authentication Repository class.
    /// Note: this repository class is different from others (i.e. no CRUD operations) 
    /// and therefore does not need to implement IRepository<T> (like all other repositories).
    /// </summary>
    public class AuthRepository :  IAuthRepository
    {
        ///// <summary>
        ///// GetToken must be the first call into web service. 
        ///// It establishes a session on the server and retrieves a newly created accesstoken.
        ///// </summary>
        ///// <returns>Unique access token that is valid for the duration of the session.</returns>
        //public string GetToken()
        //{
        //    //var request = new TokenRequest();
        //    //request.RequestId = RequestHelper.RequestId;
        //    //request.ClientTag = RequestHelper.ClientTag;

        //    //var response = Client.GetToken(request);

        //    //Correlate(request, response);

        //    //return response.AccessToken;
        //}

        ///// <summary>
        ///// Login to the system.
        ///// </summary>
        ///// <param name="username">User name.</param>
        ///// <param name="password">Password.</param>
        ///// <returns>Success or failure flag.</returns>
        //public bool Login(string username, string password)
        //{
        //    var request = new LoginRequest().Prepare();
        //    request.UserName = username;
        //    request.Password = password;

        //    var response = Client.Login(request);

        //    Correlate(request, response);

        //    return response.Acknowledge == AcknowledgeType.Success;
        //}

        ///// <summary>
        ///// Logout from from the system.
        ///// </summary>
        ///// <returns>Success or failure flag.</returns>
        //public bool Logout()
        //{
        //    var request = new LogoutRequest().Prepare();
        //    var response = Client.Logout(request);

        //    Correlate(request, response);

        //    return response.Acknowledge == AcknowledgeType.Success;
        //}
        public string GetToken()
        {
            throw new System.NotImplementedException();
        }

        public bool Login(string username, string password)
        {
            throw new System.NotImplementedException();
        }

        public bool Logout()
        {
            throw new System.NotImplementedException();
        }
    }
}